package xin.marcher.module.diplomacy.job;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import xin.marcher.module.diplomacy.manager.common.cache.FlushRedisCache;

import javax.annotation.Resource;

/**
 * 定时任务刷新缓存
 */
@Component
public class FlushCacheScheduler {

    @Resource
    private FlushRedisCache flushRedisCache;

    @Scheduled(cron = "0 0/5 * * * ?")
    public void start() {
        flushRedisCache.flushRedisStringData(true, null, null);
        flushRedisCache.flushRedisSetData(true, null, null);
        flushRedisCache.flushRedisSortedSetData(true, null, null);
    }
}
